﻿using System;
using System.Collections.Generic;

namespace YJKAreaCutter.Utils
{
	public class GeometryInfoOperator
	{
		public static GeometryPoint GetGeometryCenter(List<GeometryPoint> arPoints)
		{
			GeometryPoint result = null;
			double num = 0.0;
			double num2 = 0.0;
			double num3 = 0.0;
			int num4 = 0;
			foreach (GeometryPoint geometryPoint in arPoints)
			{
				num += geometryPoint.X;
				num2 += geometryPoint.Y;
				num3 += geometryPoint.Z;
				num4++;
			}
			if (num4 > 0)
			{
				result = new GeometryPoint(num / (double)num4, num2 / (double)num4, num3 / (double)num4);
			}
			return result;
		}
	}
}
